var app = require('express')();
var http = require('http').createServer(app);
var io = require('socket.io')(http);

app.get('/', function (req, res) {
    res.sendFile(__dirname + '/index.html');
});


io.on('connection', function (socket) {
    console.log('[socket1] a user connected');

    socket.send(`connected to socket1`)

    socket.on('disconnect', function () {
        console.log('user disconnected');
    });
});

http.listen(3003, function () {
    console.log('listening on *:3003');
});